<?php
namespace Frame\Libs;
use Frame\Vendor\PDOWrapper;

abstract class BaseModel {
    protected $pdo=NULL;
    private static $arrModelObj=array();
    public function __construct()
    {
        $this->pdo = new PDOWrapper();
    }
    //创建静态模型类
    public static function getInstance() {
        //获取静态化方式调用的类名
        $modelClassName=get_called_class();
        //echo $modelClassName;
        //
        if(!isset(self::$arrModelObj[$modelClassName])) {
            self::$arrModelObj[$modelClassName]=new $modelClassName();
        }
        return self::$arrModelObj[$modelClassName];
    }
}
